#!/bin/bash

# 更新软件包列表
sudo apt-get update

# 安装 screen
sudo apt-get install -y screen

# 创建 qb1 文件夹并下载安装程序
mkdir qb1
cd qb1
wget https://dl.qubic.li/downloads/qli-Client-1.9.0-Linux-x64.tar.gz
tar -xvf qli-Client-1.9.0-Linux-x64.tar.gz

# 清空 qb1 文件夹中的 appsettings.json 文件
echo '{}' > appsettings.json

# 编辑 qb1 文件夹中的 appsettings.json 文件
echo '{
  "Settings": {
    "baseUrl": "https://mine.qubic.li/",
    "allowHwInfoCollect": true,
    "overwrites": {
      "CUDA": "12"
    },
    "accessToken": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJJZCI6IjcwMDFkNjM5LTFmZmUtNGQxNS04YTllLWFmNDNkMDdlZjEwNSIsIk1pbmluZyI6IiIsIm5iZiI6MTcxMDUwNzYzNiwiZXhwIjoxNzQyMDQzNjM2LCJpYXQiOjE3MTA1MDc2MzYsImlzcyI6Imh0dHBzOi8vcXViaWMubGkvIiwiYXVkIjoiaHR0cHM6Ly9xdWJpYy5saS8ifQ.kp4yNneDp11EaYUS0FAa4nMBR8Cl6O1xHLDISkfhq-3iED-dved2KTuhO7IP2HLbSQLehip1OSYPo1vzhjilnA",
    "alias": "3070"
  }
}' > appsettings.json

# 返回上一级目录
cd ..

# 创建 qb2 文件夹并下载安装程序
mkdir qb2
cd qb2
wget https://dl.qubic.li/downloads/qli-Client-1.9.0-Linux-x64.tar.gz
tar -xvf qli-Client-1.9.0-Linux-x64.tar.gz

# 清空 qb2 文件夹中的 appsettings.json 文件
echo '{}' > appsettings.json

# 编辑 qb2 文件夹中的 appsettings.json 文件
echo '{
  "Settings": {
    "baseUrl": "https://ai.diyschool.ch/",
    "amountOfThreads": 16,
    "payoutId": null,
    "accessToken": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJJZCI6IjcwMDFkNjM5LTFmZmUtNGQxNS04YTllLWFmNDNkMDdlZjEwNSIsIk1pbmluZyI6IiIsIm5iZiI6MTcxMDUwNzE2NiwiZXhwIjoxNzQyMDQzMTY2LCJpYXQiOjE3MTA1MDcxNjYsImlzcyI6Imh0dHBzOi8vcXViaWMubGkvIiwiYXVkIjoiaHR0cHM6Ly9xdWJpYy5saS8ifQ.SkBceNkjalL0NLIhEjgaby40bLUQbY1LDdky1AbsJLnPJWq2KyEqHG4JhQn3bnl_2XCCsilhKkvuBvbpxudrdg",
    "alias": "3700x"
  }
}' > appsettings.json

# 返回上一级目录
cd ..
